package org.springboot.base.config;

import org.springboot.base.demo.service.DemoService;
import org.springboot.base.demo.service.impl.DemoServiceImpl;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author ZJL
 * @DateTime 2019年2月18日 下午3:49:35
 * java config 信息的对应
 **/
@Configuration
public class JavaConfig {
	
	/** 以下内容是等价的：
	 * 注册bean定义层面 基于XML的配置形式是这样： 
	 * <bean id="mockService" class="..MockServiceImpl">
	 * ... </bean>
	 **/
	
	@Bean
	public DemoService demoService() {
		return new DemoServiceImpl();
	}
	
	/*
	 * <bean id="mockService" class="..MockServiceImpl"> 
	 * 		<propery name="dependencyService" ref="dependencyService" /> 
	 * </bean>
	 * 
	 * <bean id="dependencyService" class="DependencyServiceImpl"></bean>
	 */
	
	/**
	 * @Bean public MockService mockService(){ return new
	 * MockServiceImpl(dependencyService()); }
	 * 
	 * @Bean public DependencyService dependencyService(){ return new
	 * DependencyServiceImpl(); }
	 **/
 
	
 
}
